@import '@/styles/color';
@import '@/styles/token';

.chat-container {
  width: 100%;
  margin: 0 auto;
  gap: @marginXxs;
  padding: @paddingXxs;
  border-radius: 10px;
  background: @colorBgContainer;
  box-sizing: border-box;
  transition: box-shadow 0.3s;
  border: @lineWidth solid @colorBorderSecondary;
  box-shadow: 0 9px 45px 0 rgba(0, 0, 0, 5%), 0 2px 10px 0 rgba(0, 0, 0, 3%),
    0 1px 3px 0 rgba(0, 0, 0, 2%);

  .file-title {
    font-size: @fontSizeSm;
    color: @colorTextDescription;
  }

  .input {
    font-size: @fontSize;
    line-height: @fontHeightSm;
    caret-color: @colorPrimary;
    width: 100%;
    border: none;
    background-color: transparent;
    resize: none;
    color: @colorText;
  }

  :global {
    .ant-input-outlined:focus,
    .ant-input-outlined:focus-within {
      border: none;
      box-shadow: none;
    }
  }

  .footer {
    gap: @marginSm;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .model-selector {
      color: @colorTextSecondary;
      padding: 6px @paddingXs;
      border-radius: @borderRadius;
      transition: background-color ease-in-out 0.2s;

      &:hover {
        background-color: @colorPrimaryBg;
      }

      .model-arrow {
        font-size: 12px;
        color: @colorTextDescription;
      }
    }

    .svg-icon {
      color: @colorTextDescription;
      background-color: @colorBgContainerDisabled;
      border-radius: 50%;
    }

    .box {
      padding: @paddingXs;
      border-radius: @borderRadius;
      height: 36px;

      &.upload-box-disabled {
        cursor: not-allowed;
        color: @colorIcon !important;
        background-color: @colorBgContainerDisabled !important;
      }

      .loading-box {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      &.send-box {
        font-size: @fontSizeSm;
        transition: color ease-in-out 0.2s;
        color: @colorWhite;
        background-color: @colorPrimary;
        width: 36px;
        height: 36px;

        &.disabled {
          color: @colorIcon;
          cursor: not-allowed;
          background-color: @colorBgContainerDisabled;
        }

        // 停止按钮样式
        &.stop-box {
          &.disabled {
            cursor: not-allowed;
            color: @colorIcon;
            background-color: @colorBgContainerDisabled;
          }

          // 停止按钮高亮样式 - 当会话进行中且可点击时
          &.stop-box-active {
            background-color: @colorInfoBg;
            color: @colorPrimary;
            transition: background-color ease-in-out 0.2s;

            &:hover:not(.disabled) {
              background-color: @colorInfoBgHover;
            }
          }
        }
      }
    }
  }
}

// 选中文件显示
.selectedFileDisplay {
  max-width: 150px;
  font-size: @fontSizeSm;
  padding: 0 8px;
  border-radius: @borderRadiusSm;
  transition: all 0.2s ease;
  cursor: default;

  &:hover {
    .close-icon {
      opacity: 1;
      visibility: visible;
    }
  }

  .file-name {
    flex: 1 0 auto;
  }

  .close-icon {
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
  }
}

// 加载图标样式
.loading-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.model-selector-popover {
  width: 300px;
  gap: @marginSm;

  .select-list {
    width: 100% !important;
  }
}
